<!DOCTYPE html>
<html lang="zh-cn">
	<head>
  		<meta charset="utf-8">
      	<meta http-equiv="X-UA-Compatible" content="IE=edge">
      	<link rel="shortcut icon" href="favicon.ico"/>
      	<title>忘记支付密码 - {$CONF['mallTitle']}</title>
      	<meta name="keywords" content="{$CONF['mallKeywords']}" />
      	<meta name="description" content="{$CONF['mallDesc']},忘记密码" />
      	<link rel="stylesheet" href="__ROOT__/Apps/Home/View/{$WST_STYLE}/css/common.css">
     	<link rel="stylesheet" href="__ROOT__/Apps/Home/View/{$WST_STYLE}/css/footer.css">

   	</head>
   	<body>
	<div id="shortcut-2013">
		<include file="./Apps/Home/View/default/header_nav.html" />
	</div>
	<div class="main">
	    <div class="main-top">
	        <div class="forget-pwd">
	            <h5>找回支付密码</h5>
	            <div id="stepflex" class="stepflex" style='width:500px;'>
	                <dl class="first doing">
	                    <dt class="s-num">1</dt>
	                    <dd class="s-text">验证身份<s></s><b></b></dd>
	                    <dd></dd>
	                </dl>
	                <dl class="normal done">
	                    <dt class="s-num">2</dt>
	                    <dd class="s-text">设置新支付密码<s></s><b></b></dd>
	                </dl>
	                <dl class="normal">
	                    <dt class="s-num">3</dt>
	                    <dd class="s-text">完成<s></s><b></b></dd>
	                </dl>
	            </div>
	            <form method="post" id="loginForm" action="<?php echo U('Users/findPwd'); ?>" autocomplete="off">
	            <input type="hidden" name="steps" value="1">
	            <input type="hidden" name="userPhone" id="userPhone" value="<?php echo $forgetInfo['userPhone']; ?>">
	            <input type="hidden" name="loginName" id="loginName" value="<?php echo $forgetInfo['loginName']; ?>">
	            <table style="margin:0 auto;width:570px" class='forgettbl2'>
	                    <tbody>
	                        <tr>
	                            <th width='180px' nowrap>请选择验证身份方式：</th>
	                            <td><select name="type" id="type">
	                                <option value="phone">手机</option>
	                                <option value="email">邮箱</option>
	                            </select></td>
	                            <td><div id="typeTip" style="width:280px;text-align:left;"></div></td>
	                        </tr>
	                        <tr>
	                            <th>用户名：</th>
	                            <td colspan='2'>{$forgetInfo['loginName']}</td>
	                        </tr>
	                        <tr class="phone-verify">
	                            <th>手机：</th>
	                            <td colspan='2'><?php echo $forgetInfo['userPhone'] == '' ? "没有预留手机号码，请尝试用邮箱找回！" : $forgetInfo['userPhone'] ; ?></td>
	                        </tr>
	                        <?php if($forgetInfo['userPhone'] != ''){ ?>
	                        <tr class="phone-verify">
	                            <th>请填写手机校验码：</th>
	                            <td>
	                                <input type="text" class='text' style='width:130px;' name="phoneVerify" id="phoneVerify">
	                            </td>
	                            <td><input class='btn-red' type="button" value="点击获取" id="getPhoneVerifyp"></td>
	                        </tr>
	                        <tr class="phone-verify">
	                            <td></td>
	                            <td colspan='2'><span id="phoneVerifyTip" style="width:280px;text-align:left;"></span></td>
	                        </tr>
	                        <tr class="phone-verify">
	                            <td colspan='3' style='padding-left:150px;'>
	                                <input class='btn-red' type="submit" id="goform" value="下一步">
	                            </td>
	                        </tr>
	                        <?php } ?>
	                        <tr class="email-verify">
	                            <th>邮箱地址：</th>
	                            <td colspan='2'><?php echo $forgetInfo['userEmail'] == '' ? "没有预留邮箱，请尝试用手机号码找回！" : $forgetInfo['userEmail'] ; ?></td>
	                        </tr>
	                        <?php if ($forgetInfo['userEmail'] != ''){ ?>
	                        <tr class="email-verify">
	                            <td colspan='3' style='padding-left:150px;'>
	                                <input class='btn-red' type="button" id="sendEmailp" value="发送验证邮件">
	                            </td>
	                        </tr>
                            <?php } ?>
	                    </tbody></table>
	
	                </form>
	            </div>
	            <div class="clearfix"></div>
	        </div>
	    </div>
	</div>
	<!--footer start--> 
	<include file="./Apps/Home/View/default/footer.html" />
	<!--footer end-->
	</body>
	<script src="__PUBLIC__/plugins/formValidator/formValidator-4.1.3.js"></script>
	<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
    <script src="__PUBLIC__/js/common.js"></script>
    <script src="__ROOT__/Apps/Home/View/{$WST_STYLE}/js/common.js"></script>
    <script src="__ROOT__/Apps/Home/View/{$WST_STYLE}/js/findpass.js"></script>
	<script type="text/javascript">
	var resetPassUrl = '';
	var findPassTime = 0;
	$(document).ready(function(){
	    $('#type').change(function(){
	        if ($('#type').val() == 'phone') {
	            $('.phone-verify').show();
	            $('.email-verify').hide();
	        }else{
	            $('.phone-verify').hide();
	            $('.email-verify').show();
	        }
	    })
	    $.formValidator.initConfig({formID:"loginForm",theme:"Default",debug:true,submitOnce:true,onSuccess:function(){
			   location.href=resetPassUrl;
		       return false;
		    },
	        onError:function(msg,obj,errorlist){
	            console.log(msg);
	        },
	        ajaxPrompt : '有数据正在异步验证，请稍等...'
	    });
	   $("#phoneVerify").formValidator({onShowText:"请输入手机验证码",onShow:"",onFocus:"",onCorrect:"手机验证码正确"}).inputValidator({min:6,max:6,onError:"手机验证码错误"})
	        .ajaxValidator({
	        dataType : "json",
	        async : true,
	        url : "<?php echo U('Home/Users/checkPhoneVerifyp'); ?>",
	        success : function(data){
	        	var json = WST.toJson(data);
	            if( json.status == "1" ) {
	            	resetPassUrl = json.url;
	                return true;
				} else {
					return "手机验证码错误,请检查！";
				}
	            return "手机验证码错误,请检查！";
	        },
	        buttons: $("#goform"),
	        error: function(jqXHR, textStatus, errorThrown){WST.msg("服务器没有返回数据，可能服务器忙，请重试"+errorThrown);},
	        onError : "手机验证码错误！",
	        onWait : "正在对手机验证码进行合法性校验，请稍候..."
	    });
	});
	</script>
	<style>
   	.layui-layer-btn a{background:#e23c3d;}
   	</style>
</html>